home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / prog_d / ssbc15.zip / MANUAL.TXT < prev    next >
Text File  |  1996-04-15  |  15KB  |  263 lines

  1. ssBarCode version 1.5
  2. The Delphi Native Bar code Component - 16-bit version
  3.  
  4. Soft Sector, Inc.
  5. PO Box 81480
  6. Cleveland OH 44181
  7.  
  8. See the document ORDER.TXT for ordering information.
  9.  
  10. See the end of this document for the new features in this version.
  11.  
  12. Introduction
  13. Thank you for your interest in our bar coding VCL.  There are many bar coding products for developers in existence, but all are either in DLL or VBX form.  With the release of ssBarCode from Soft Sector, Inc., developers now have a Delphi-native option to implement bar coding into their applications.
  14.  
  15. In this first version, ssBarCode supports the four most popular bar code symbologies:  Code 39 (or 3 of 9), Interleaved 2 of 5, Postnet, and UPC version A.  In the near future we will be implementing many more symbologies.  Please see the section of this file entitled "Future Enhancements."
  16.  
  17. About Soft Sector, Inc.
  18. Soft Sector, Inc. (SSI) is a Cleveland, OH based provider of hardware and software solutions.  Our main language for development is Borland Delphi.  In the course of our application development, we have created a number of components and tools that would be useful to other developers.  We are in the process of packaging these components for retail distribution.
  19.  
  20. Contacting Soft Sector, Inc.
  21. We can be contacted in a variety of ways:
  22.  
  23. US Mail:  Soft Sector, Inc., PO Box 81480, Cleveland, OH 44181 USA
  24. E-Mail:  ssi@en.com
  25. Phone/fax:  (216) 777-3612
  26.  
  27. Keep an eye out for our Web page, coming soon!
  28.  
  29. Installation
  30. You can install ssBarCode as you would any other component.  Specifically, follow these steps:
  31.  
  32. 1.  Place all files that were contained in the .ZIP file into a directory (example:  \SSBC)
  33.  
  34. 2.  Go into Delphi and access the OPTIONS pulldown menu.  Then choose INSTALL COMPONENTS...
  35.  
  36. 3.  Click on the ADD button.  Another dialog box will pop up.  Click on the BROWSE button.
  37.  
  38. 4.  A file selection common dialog will pop up.  Select the directory where you put the ssBarCode files.  In the "List Files of Type" drop down, you should select "DCU" files.
  39.  
  40. 5.  You will see "SSBC.DCU" appear in the files list box.  Select it and click OK.
  41.  
  42. 6.  Now click OK in the Install Components dialog box.  DelphiÆs VCL will now recompile.  When itÆs done, you should have a palette page named "Soft Sector".  On it will appear an icon for the ssBarCode component.
  43.  
  44. ThatÆs all there is to it!  YouÆre now ready to start creating bar codes!
  45.  
  46. Note that this restricted version of ssBarCode will only run while the Delphi IDE is running.  That means in order to include it in your applications, you must pay the registration fee!  See the file ORDER.TXT for more information on this extremely useful, yet affordable product.
  47.  
  48. Demo Program
  49. WeÆve written a simple demo program to show off some of the features of ssBarcode, including the different symbologies, bar width specification, and barcode printing.  The project name is DEMOBC.DPR.  All of the features of this demo program are very easy to understand, and some of the code is commented.
  50.  
  51. Properties 
  52. AutoSize
  53. BarCodeType
  54. BarColor
  55. BarWidth
  56. BearerBars
  57. CalcCheckDigit
  58. Canvas (*)
  59. Color (*)
  60. Data
  61. Orientation
  62. PrintHumanReadable
  63. Visible (*)
  64. WideBarRatio
  65.  
  66. (*)  These are inherited properties that are not described in this document.  See the Delphi help file for details.
  67.  
  68. AutoSize property
  69.  
  70. Declaration
  71. property AutoSize : boolean
  72.  
  73. Description
  74. The AutoSize property will automatically size the bar code to certain proportions based a number of calculations.  The first factor is the BarWidth property; the width of the component will be the BarWidth property times the actual number of bars and spaces.  The height of the component will be based on the standard accepted height to width ratio for each symbology.
  75.  
  76. If you set AutoSize to false, you can size the component as you see fit.  However, there is no guarantee that the resulting code will fit in the space you allot.
  77.  
  78. BarCodeType property
  79.  
  80. Declaration
  81. property BarCodeType : TBarCodeType 
  82.  
  83. Description
  84. This is the main property of the component.  It defines which symbology you want to use to create the bar code.  The possible values for TBarCodeType are:
  85.  
  86. {bcCode39, bcInt2of5, bcPostnet, bcUPC_A}
  87.  
  88. See the section below entitled "Symbologies" for a more in-depth description of each symbology.  
  89. When you set the BarCodeType property, the program will check the Data property to see if the data entered is acceptable for the chosen bar code type.  For example, you cannot have alpha characters in an Interleaved 2 of 5 code.  If the data is not acceptable, an exception of type EBarCodeError will be raised.
  90.  
  91. BarColor property
  92.  
  93. Declaration
  94. property BarColor : TColor 
  95.  
  96. Description
  97. Use this property to set a color for the actual bars themselves as well as the human readable text beneath the bar code.  Note that for best scanning, bar codes should be black bars on a white background, but you do have the option to change this.
  98.  
  99. BarWidth property
  100.  
  101. Declaration
  102. property BarWidth : single 
  103.  
  104. Description
  105. This property allows you to change the width, in inches, of each bar.  For bar codes that have a narrow to wide bar ratio, the wide bar width is calculated based on the WideBarRatio property.  If you have the AutoSize property set to True, the component will resize when you change this property.
  106.  
  107. Each symbology has a standard accepted BarWidth, listed below.  Of course, these are only recommendations and you are free to use whatever width you choose.
  108.  
  109. Code 39 = 0.010 inches
  110. Interleaved 2 of 5 = 0.015 inches
  111. Postnet = 0.020 ** (We strongly recommend using this value for Postnet)
  112. UPC A = 0.013 inches
  113.  
  114.  
  115. BearerBars property
  116.  
  117. Declaration
  118. property BearerBars : boolean 
  119.  
  120. Description
  121. Certain bar code symbologies call for bearer bars, or horizontal lines that run along the top and bottom of the code.  The reason for these bars is that a partial scan can sometimes be interpreted as a complete scan.  Bearer bars greatly reduce the chance of this happening.  
  122.  
  123. As of version 1.0, only Interleaved 2 of 5 bar codes can have bearer bars.  The other symbologies do not need them.  If you try to set BearerBars equal to True for any other symbology, an EBarCodeError exception will be raised.
  124.  
  125. CalcCheckDigit property
  126.  
  127. Declaration
  128. property CalcCheckDigit : boolean 
  129.  
  130. Description
  131. Set this property to True if you want the component to automatically generate the check digit for UPC A bar codes.  If CalcCheckDigit is False, then you must provide all 12 digits of the UPC code in the Data property, or an exception will be raised.
  132.  
  133. Data property
  134.  
  135. Declaration
  136. property Data : string 
  137.  
  138. Description
  139. This property is where you set the actual data to be encoded.  Data for each bar code symbology must follow certain rules or an exception will be raised.  See the section below entitled "Symbologies" for a description of acceptable data for each type of bar code.
  140.  
  141. Orientation property
  142.  
  143. Declaration
  144. property Orientation : TOrientation 
  145.  
  146. Description
  147. The Orientation property is used to rotate the bar code in 90 degree increments.  You would never want to have a bar code that is not rotated in an increment of 90 degrees.  The human readable text is obviously also rotated.  The possible values for TOrientation are:
  148.  
  149. {orLeft_Right, orRight_Left, orTop_Bottom, orBottom_Top}
  150.  
  151. orLeft_Right means that the bar code is created from Left to Right (it is the default).  orTop_Bottom means that the bar code is created from Top to Bottom, etc.
  152.  
  153. PrintHumanReadable property
  154.  
  155. Declaration
  156. property PrintHumanReadable : boolean 
  157.  
  158. Description
  159. This property allows you to set whether the component will output the human readable version of the bar code (i.e. the actual letters or numbers).  Bar codes like UPC A should always have this set to True.  As for the other bar codes, it is completely up to you.
  160.  
  161. Note that, in this version, all human readable text is printed using the Courier font.
  162.  
  163. WideBarRatio property
  164.  
  165. Declaration
  166. property WideBarRatio : single
  167.  
  168. Description
  169. This property affects the narrow-to-wide bar ratio for symbologies that have such elements.  The value you give this property will be multiplied by the value of BarWidth to get the wide bar width.  Most symbologies dictate a wide bar ratio in the 2.0 to 3.0 range.  You will want a higher WideBarRatio if your BarWidth is very small.  Most applications call for this ratio to be 3.0.
  170.  
  171. Methods
  172. There is only one available method, aside from the constructor for this component.  The constructorÆs implementation is as follows:
  173.  
  174. constructor Create(AOwner : TComponent); 
  175.  
  176. PrintBarcode Method
  177.  
  178. Declaration
  179. procedure PrintBarcode(X, Y, Height : single);
  180.  
  181. Description
  182. This method makes it extremely easy to print barcodes from your application.  Simply create an instance of ssBarcode, either at design-time or run-time, set the properties you need, and then call this method.  ssBarcode handles all of the sticky implementations of printing, such as printer resolutions, margins, etc.  
  183.  
  184. To use this method, supply X and Y values for the upper left hand corner of the barcode, in inches.  The Height parameter allows you to specify an exact height of the barcode, in inches.  You can also pass 0 (zero) as the Height, and ssBarcode will calculate the Height based on standard height-to-width ratio for the current symbology.
  185.  
  186. ** IMPORTANT NOTE **  This method uses the Printer variable (defined in the Printers unit that came with Delphi) to handle the physical printer.  As such, you must follow the code below to print barcodes:
  187.  
  188. {procedure name}
  189.  
  190. begin
  191.   Printer.Canvas.Font := æCourier NewÆ; {****}
  192.   Printer.BeginDoc; {****}
  193.   ssBarCode1.PrintBarcode(1.0,1.0,0);
  194.   {any other output to the printer here}
  195.   Printer.EndDoc; {****}
  196. end;
  197.   
  198. The lines with asterisks are absolutely critical.  If you do not include them, it is unlikely that the barcode will print.
  199.  
  200. Another thing to note:  the PrintBarcode method pays no attention to the AutoSize or Width properties.  PrintBarcode will always print the entire barcode with no clipping.
  201. Events
  202. The events defined for ssBarCode are inherited from standard Delphi events.  See DelphiÆs help file for details.
  203.  
  204. OnClick
  205. OnDblClick
  206. OnMouseDown
  207. OnMouseMove
  208. OnMouseUp
  209.  
  210. Symbologies
  211. A symbology is a set of rules that govern how to create a bar code based on what data is being coded.  There are many symbologies in existence, some general purpose and others for very specific applications.  Each bar code has its proÆs and conÆs.  This version of ssBarCode contains the four major symbologies, as described below.
  212.  
  213. Code 39 (or 3 of 9)
  214. Code 39 was the first alphanumeric symbology to be developed.  It is now in wide use and is the de facto standard for non retail applications.  It can encode the 26 letters of the alphabet (in upper case), the 10 digits, and the symbols "- . $ / + %"  Code 39 gets its name because each character has five bars and four spaces (nine elements); of those nine, three are wide.  Thus, "3 of 9."  If you need to encode any non-numeric data, this is the code to choose.
  215.  
  216. Interleaved 2 of 5
  217. Interleaved 2 of 5 (sometimes abbreviated I2of5 or ITF) is a high-density, continuous numeric symbology mainly used in the distribution industry.  Many packages you receive have ITF bar codes on them.  ITF is a very efficient symbology because it encodes data both in the bars and spaces.  Each digit is made up of five bars, of which two are wide; thus the name "2 of 5".  Since data is encoded in both bars and spaces, all ITF bar codes musthave an even number of digits!  Many applications will add a trailing zero if the number to be encoded contains an odd number of digits.  If you are encoding less than ten digits, ITF is the most efficient bar code.
  218.  
  219. One of the problems with ITF is that a partial scan has a high probability of decoding as a valid, but shorter, ITF symbol.  To minimize this risk, ITF bar codes are often used with bearer bars (sometimes called protection stripes).  Bearer bars are horizontal bars running along the top and bottom of the symbol.  They decrease the probability that a partial scan will decode as valid.
  220.  
  221. Postnet
  222. This symbology was developed by the United States Post Office for the purpose of marking postal items so that they could be sorted by automatic equipment.  In the strictest sense, Postnet is not a bar code, since information is not encoded into the widths of the bars.  Postnet encodes using the heights of the bars instead.  Postnet codes generally match the length of a Zip code; that is, either 5 or 9 digits.  Recently, the Post Office has accepted a Postnet code with 11 digits, the last two being used as the first two digits of a street address, PO Box, apartment number, etc.  For more information about the proper use of Postnet codes, contact your local Post Office.
  223.  
  224. UPC version A
  225. UPC (Universal Product Code) is the bar code of choice for the retail industry in the United States.  UPC is a coding system as well as a symbology; it is designed to uniquely identify a product and its manufacturer.  The actual UPC code is a 10-digit code:  the first five digits represent the manufacturer, the next five as a unique product identifier code assigned by the manufacturer.  This 10-digit code is preceded with a "number system" digit and followed by a check digit.  Thus the UPC-A bar code encodes 12 digits of data.
  226.  
  227. When you apply for a UPC manufacturer number, the UCC (Uniform Code Council) assigns you a six digit number; the first digit is a "Number System" digit from 0 to 9.  The meanings of each of these digits is listed below.  The next five digits is your actual manufacturer number.
  228.  
  229. The Number System assignments are as follows:
  230.  
  231. 0 - 92,000 manufacturer identification numbers; 8,000 locally assigned numbers
  232. 1 - Reserved
  233. 2 - Random weight consumer packages
  234. 3 - Drug products
  235. 4 - In-store marking without format
  236. 5 - UPC coupons
  237. 6 - 100,000 manufacturer identification numbers
  238. 7 - 100,000 manufacturer identification numbers
  239. 8 - Reserved
  240. 9 - Reserved
  241.  
  242. Since all UPC-A codes encoded 12 digits of data, UPC-A is a fixed-width symbology.
  243.  
  244. Future Enhancements
  245. This is version 1.0 of ssBarCode.  As such, we have many ideas and features that we will be adding the near future.  If you have any comments or suggestions, feel free to let us know.  The rate at which we add these new features will be directly proportional to the amount of registrations we receive (hint, hint :) )
  246.  
  247. - Additional symbologies:  UPC-E, EAN-8, EAN-13, Codabar, Code 128, FIM, Bookland, UPC add on codes
  248. - Data aware:  allowing you to assign a Datasource and Datafield to the bar code component 
  249. - Auto detecting symbologies based on the data to be encoded
  250. - Allowing the component user to set the font to use for human readable text
  251. - Windows .HLP file
  252.  
  253. Revision History
  254. 04-15-96  Version 1.5
  255. - Changed the BarWidth to type Single.  Now you specify the BarWidth in Inches (generally fractions thereof)
  256. - Added property WideBarRatio, allowing you to specify the narrow-to-wide bar ratio for symbologies that support it (Code 39 and Int2of5)
  257. - Added method PrintBarcode, allowing you to easily print barcodes on any Windows-supported printer
  258.  
  259. 03-24-96   Version 1.0
  260. Initial public release
  261.  
  262.  
  263.